#include "StreamSingleVideoSource.h"
#include "OStreamReceiver.hh"
StreamSingleVideoSource::StreamSingleVideoSource(void): BaseInputVideo()
{
	_initialized = false;
	_started = false;
}

StreamSingleVideoSource::~StreamSingleVideoSource(void)
{
}
bool StreamSingleVideoSource::init_device()
{
	/*_receiver = new OStreamReceiver( "rtsp://192.168.1.103/003.ts",
		NULL, this,
		NULL, this );*/

	// ourSocket = socket(AF_INET, SOCK_DGRAM, 60000);

	
	_initialized = true;
	return true;
}

IplImage * StreamSingleVideoSource::get_next_frame ()
{
	IplImage *tmp_image;
	IplImage *res_image;
	if ( !_initialized ) {
		// try to initialize the device. If it returns false then we'll return NULL
		if ( init_device () == false )
			return NULL;
	}

	//_receiver->buffered_sink->afterGettingFrame1();
	//_receiver->buffered_sink->continuePlaying();
	return res_image;
}

IplImage * StreamSingleVideoSource::get_next_frame_by_stream_id( int stream_id ) 
{ 
	return NULL; 
}

void StreamSingleVideoSource::add_image_by_stream_id( IplImage *image, int stream_id, 
													 char* __unused__, void* callback_data  ) 
{
}

bool StreamSingleVideoSource::is_multi_stream() 
{
	return false;
}